package com.joysuch.wwyt.bp.entity.risk;

import com.joysuch.wwyt.core.support.AutoSetCommonFieldListener;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.annotations.SQLDelete;
import org.hibernate.annotations.SQLDeleteAll;
import org.hibernate.annotations.Where;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.time.LocalDate;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * 风险研判-公司级
 *
 * @Author ZhangDong
 * @Date 2020/3/16 11:08
 */
@EntityListeners({AuditingEntityListener.class, AutoSetCommonFieldListener.class})
@Entity
@Table(name = "wwyt_bp_judge_company")
@SQLDelete(sql = "update wwyt_bp_judge_company set DELETE_FLAG = '1' where id= ?")
@SQLDeleteAll(sql = "update wwyt_bp_judge_company set DELETE_FLAG = '1' where id= ?")
@Where(clause = "DELETE_FLAG = '0'")
@Data
public class BpCompany {

    @Id
    @GeneratedValue(strategy = IDENTITY)
    @ApiModelProperty("主键id")
    private Long id;

    //生产装置

    @ApiModelProperty("合计数量")
    private Integer deviceSum;

    @ApiModelProperty("运行数量")
    private Integer deviceExecuteSum;

    @ApiModelProperty("停产数量")
    private Integer deviceStopSum;

    @ApiModelProperty("检修数量")
    private Integer deviceRepairSum;

    @ApiModelProperty("特种作业Json串")
    private String specialWork;

    @ApiModelProperty("是否处于试生产")
    private String preProduceOrNot;

    @ApiModelProperty("是否处于开停车状态")
    private String driveOrNot;

    @ApiModelProperty("重大危险源")
    private String harzard;

    @ApiModelProperty("企业承诺")
    private String enterprisePromise;

    @ApiModelProperty("主要负责人")
    private String mainCharger;

    @ApiModelProperty("发布公司")
    private String releaseCompany;

    @ApiModelProperty("公告时间")
    private LocalDate announceTime;

    @ApiModelProperty("发布人姓名")
    private String releaseUserName;

    @ApiModelProperty("公告状态")
    private String announceStatus;

    @ApiModelProperty("罐区、仓库等重大危险源是否处于安全状态")
    private String majorHazardIsSafe;

    @ApiModelProperty("是否有外来承包商")
    private String hasContractor;

    @ApiModelProperty("签名")
    private String autograph;

    //风险等级 参照枚举 RiskLevels
    @ApiModelProperty("风险等级")
    private Integer riskLevel;

    //通用字段
    @ApiModelProperty("创建人")
    @org.springframework.data.annotation.CreatedBy
    private Long createBy;

    @ApiModelProperty("创建时间")
    @org.springframework.data.annotation.CreatedDate
    private java.time.LocalDateTime createTime;

    @ApiModelProperty("更新人")
    @org.springframework.data.annotation.LastModifiedBy
    private Long updateBy;

    @ApiModelProperty("更新时间")
    @org.springframework.data.annotation.LastModifiedDate
    private java.time.LocalDateTime updateTime;

    @ApiModelProperty("租户")
    private Long tenentId;

    @ApiModelProperty("组织机构代码")
    private String orgCode;

    @ApiModelProperty("删除标记")
    private String deleteFlag;
}
